package com.tyj.movie.config.security;

import com.tyj.movie.entity.Users;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 日期: 2021/6/7 14:26
 * 作者: 谭友杰
 * 类说明:
 */
public class UserDetailsPacking extends User {

    private Users users;

    public UserDetailsPacking(Users users, Collection<? extends GrantedAuthority> authorities) {
        super(users.getUsername(), users.getPassword(), authorities);
        this.users =users;
        this.users.setPassword(null);
        this.users.setCreateDate(users.getCreateDate());
        this.users.setHeadImgUrl(users.getHeadImgUrl());
    }

    public Users getUsers() {
        return users;
    }
}
